﻿using System;
using System.Collections.Generic;
using System.Text;
using PostSharp.Aspects.Dependencies;

namespace Arcana.Contract.Property.All.Are.Greater
{
    [Serializable]
    [ProvideAspectRole(Roles.Contract)]
    [ProvideAspectRole(Roles.Property)]
    [ProvideAspectRole(Roles.Conditional)]
    [AspectRoleDependency(AspectDependencyAction.Commute, Roles.Conditional)]
    public sealed class ThanAttribute : EnumerableComparingContractBase.UniversalQuantification
    {
        private object _value;

        public ThanAttribute(object value)
        {
            _value = value;
        }

        protected override bool ValidateItem(object item)
        {
            return Comparer.Compare(item, _value) > 0;
        }
    }
}
